wayland: Disconnect the frame clock
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 May 2019 10:59:38 +0000 (10:59 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:17 +0000 (20:25 +0000)
The frame clock can survive the surface now,
so we need to disconnect.

gdk/wayland/gdksurface-wayland.c

index f7bd5c9f9db09909a26f030972039b557175b705..0d1f1ba584059f7edd1034c399bedec428ccc316 100644 (file)
@@ -2819,6 +2819,7 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
                              gboolean    foreign_destroy)
 {
   GdkWaylandDisplay *display;
+  GdkFrameClock *frame_clock;
 
   g_return_if_fail (GDK_IS_SURFACE (surface));
 
@@ -2829,6 +2830,10 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
 
   gdk_wayland_surface_hide_surface (surface);
 
+  frame_clock = gdk_surface_get_frame_clock (surface);
+  g_signal_handlers_disconnect_by_func (frame_clock, on_frame_clock_before_paint, surface);
+  g_signal_handlers_disconnect_by_func (frame_clock, on_frame_clock_after_paint, surface);
+
   display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
   display->toplevels = g_list_remove (display->toplevels, surface);
 }